<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
		
<!-- Product Template Menu Item for Warehouse Manager-->
        <menuitem id="stock.menu_stock_product" name="Products" parent="stock.menu_stock_root" sequence="6" groups="stock.group_stock_manager"/>
		
		<record id="view_location_form_applico" model="ir.ui.view">
			<field name="name">stock.location.form.applico</field>
			<field name="model">stock.location</field>
			<field name="inherit_id" ref="stock.view_location_form"/>
			<field name="arch" type="xml">
				<button string="Current Stock" 
                                class="oe_stat_button" 
                                icon="fa-building-o" name="%(stock.location_open_quants)d" type="action"
                                context="{'search_default_internal_loc': 1}" position="replace">
                	<button name="%(stock.location_open_quants)d" groups="applico_v8.hidden_applico"/>
                </button>
                <field name="scrap_location" position="replace">
                	<field name="scrap_location" groups="applico_v8.hidden_applico"/>
                </field>
			</field>
		</record>
		
		<record id="view_warehouse_applico" model="ir.ui.view">
			<field name="name">stock.warehouse.applico</field>
			<field name="model">stock.warehouse</field>
			<field name="inherit_id" ref="stock.view_warehouse"/>
			<field name="arch" type="xml">
				<button name="view_all_routes_for_wh" 
                                    string="Routes"
                                    icon="fa-refresh"
                                    class="oe_stat_button" 
                                    type="object"
                                    position="replace">
                	<button name="view_all_routes_for_wh" groups="applico_v8.hidden_applico"/>
                </button> 
			</field>
		</record>
		
		<record id="view_stock_invoice_onshipping_applico" model="ir.ui.view">
			<field name="name">Stock Invoice Onshipping</field>
			<field name="model">stock.invoice.onshipping</field>
			<field name="inherit_id" ref="stock_account.view_stock_invoice_onshipping"/>
			<field name="arch" type="xml">
				<field name="group" position="replace">
					<field name="group" invisible="1"/>
				</field>
			</field>
		</record>

		<record id="view_stock_return_picking_form_inherit_applico" model="ir.ui.view">
			<field name="name">Return lines</field>
			<field name="model">stock.return.picking</field>
			<field name="inherit_id" ref="stock_account.view_stock_return_picking_form_inherit"/>
			<field name="arch" type="xml">
				<field name="invoice_state" position="replace">
					<field name="invoice_state" invisible="1"/>
				</field>
				<field name="product_return_moves" position="replace">
					<field name="product_return_moves" colspan="4">
						<tree editable="top" create="false">
							<field name="product_id" readonly="1"/>
							<field name="lot_id" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}" invisible="1"/>
							<field name="quantity"/>
						</tree>
					</field>
				</field>
			</field>
		</record>

<!--  Internal Move -->
		<record id="view_move_internal_picking_tree" model="ir.ui.view">
			<field name="name">stock.move.internal.tree</field>
			<field name="model">stock.move</field>
			<field eval="4" name="priority"/>
			<field name="arch" type="xml">
				<tree colors="grey:scrapped == True" string="Stock Moves">
					<field name="product_id"/>
					<field name="product_uom_qty" on_change="onchange_quantity(product_id, product_uom_qty, product_uom, product_uos)"/>
					<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
					<field name="product_uos_qty" groups="product.group_uos"/>
					<field name="product_uos" groups="product.group_uos"/>
					<field name="location_id" groups="stock.group_locations"/>
					<field name="picking_id" invisible="1" />
					<field name="create_date" invisible="1" />
					<field name="date_expected" invisible="1" />
					<button name="%(stock.move_scrap)d"
						string="Scrap Products" type="action"
						icon="terp-gtk-jump-to-ltr" context="{'scrap': True}"
						states="draft,waiting,confirmed,assigned"
						invisible="1"/>
					<field name="scrapped" invisible="1"/>
					<field name="availability" invisible="1"/>
					<field name="reserved_availability" invisible="1"/>
					<field name="location_dest_id" groups="stock.group_locations"/>
					<field name="remaining_qty" invisible="1"/>
					<field name="string_availability_info" invisible="1"/>
					<field name="state"/>
				</tree>
			</field>
		</record>


		<record id="view_move_internal_picking_form" model="ir.ui.view">
			<field name="name">stock.move.internal.form</field>
			<field name="model">stock.move</field>
			<field eval="90" name="priority"/>
			<field name="arch" type="xml">
				<form string="Stock Moves">
					<header>
						<button name="force_assign" invisible="1" string="Force Availability" type="object" groups="base.group_user"/>
						<button name="action_confirm" invisible="1" string="Confirm" type="object" groups="base.group_user"/>
						<button name="do_unreserve" invisible="1" string="Cancel Availability" type="object" groups="base.group_user"/>
						<field name="state" widget="statusbar" statusbar_visible="draft,assigned,done"/>
					</header>
					<group>
						<group>
							<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)"/>
							<field name="procure_method" attrs="{'readonly': [('state', '!=', 'draft')]}" groups="stock.group_adv_location"/>
							<field name="picking_type_id" invisible="1"/>
							<label for="product_uom_qty"/>
							<div>
								<field name="product_uom_qty" on_change="onchange_quantity(product_id, product_uom_qty, product_uom, product_uos)" class="oe_inline"/>
								<field name="product_uom" string="Unit Of Measure" groups="product.group_uom" class="oe_inline"/>
								<button name="%(stock.move_scrap)d"
									string="Scrap" type="action"
									icon="terp-gtk-jump-to-ltr" context="{'scrap': True}"
									states="draft,waiting,confirmed,assigned"
									invisible="1"/>
							</div>
							<label for="product_uos_qty" groups="product.group_uos"/>
							<div groups="product.group_uos">
								<field name="product_uos_qty" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)" class="oe_inline"/>
								<field name="product_uos" on_change="onchange_quantity(product_id, product_uom_qty, product_uom, product_uos)" class="oe_inline"/>
							</div>
							<field name="name"/>
							<field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_tmpl_id','=',product_id)]"/>
						</group>
						<group>
							<field name="create_date" invisible="1"/>
							<field name="date" invisible="1"/>
							<field name="date_expected" on_change="onchange_date(date,date_expected)" invisible="1"/>
							<field name="invoice_state" invisible="1"/>
						</group>
						<group string="Locations" groups="stock.group_locations">
							<field name="location_id" domain="[('usage','=','internal')]"/>
							<field name="location_dest_id" domain="[('usage','=','internal')]"/>
						</group>
						<group name="quants_grp" string="Reserved Quants" colspan="4" invisible="1">
							<field name="reserved_quant_ids"/>
						</group>
					</group>
				</form>
			</field>
		</record>

		<record id="view_internal_picking_form" model="ir.ui.view">
			<field name="name">internal.stock.picking.form</field>
			<field name="model">stock.picking</field>
			<field eval="30" name="priority"/>
			<field name="arch" type="xml">
				<form string="Internal Move">
					<header>
						<button name="action_confirm_int" states="draft" string="Mark as Todo" type="object" class="oe_highlight" groups="base.group_user"/>
						<button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight" groups="base.group_user"/>
						<button name="rereserve_pick" states="partially_available" string="Recheck Availability" type="object" class="oe_highlight" groups="base.group_user"/>
						<button name="force_assign" states="confirmed,waiting,partially_available" string="Force Availability" type="object" groups="base.group_user"/>
						<button name="action_internal_done" states="assigned,partially_available" string="Transfer" type="object" class="oe_highlight" groups="base.group_user"/>
						<button name="do_print_picking" string="Print Picking List" groups="stock.group_stock_user" type="object" attrs="{'invisible': ['|', ('picking_type_code', '=', 'outgoing'), ('state', '!=', 'assigned')]}"/>
						<button name="action_cancel" states="assigned,confirmed,partially_available,draft" string="Cancel Transfer" groups="stock.group_stock_manager" type="object"/>
						<button name="revert_invoice" attrs="{'invisible':[('invoice_state','!=','invoiced')]}" string="Revert To non Invoiced" type="object"/>
						<button name="action_cancel2" states="done" string="Cancel Transfer" groups="stock.group_stock_manager" type="object"/>
						<button name="do_unreserve" string="Unreserve" groups="base.group_user" type="object" attrs="{'invisible': [('quant_reserved_exist', '=', False)]}"/>
						<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
						<button name="%(stock_account.action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|',('state','&lt;&gt;','done'),('invoice_state','&lt;&gt;','2binvoiced')]}" type="action" class="oe_highlight" groups="base.group_user"/>
						<field name="state" widget="statusbar" statusbar_visible="assigned,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>					</header>
					<sheet>
						<div class="oe_right oe_button_box">
							<button name="do_partial_open_barcode" groups="stock.group_stock_user" type="object" class="oe_stock_scan_button" attrs="{'invisible': ['|',('pack_operation_exist', '=', True),('state','not in',('assigned', 'partially_available'))]}"><img src="/stock/static/src/img/scan.png" class="oe_stock_scan_image oe_stock_scan_image_btn"/></button>
							<button name="open_barcode_interface" groups="stock.group_stock_user" type="object" class="oe_stock_scan_button" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state','not in',('assigned', 'partially_available'))]}"><img src="/stock/static/src/img/scan.png" class="oe_stock_scan_image oe_stock_scan_image_btn"/></button>
						</div>
						<h1>
							<field name="name" class="oe_inline" attrs="{'invisible': [('name','=','/')]}" readonly="1"/>
						</h1>
						<group>
							<group>
								<field name="partner_id" invisible="1"/>
								<field name="backorder_id" readonly="1" attrs="{'invisible': [('backorder_id','=',False)]}"/>
							</group>
							<group>
								<field name="date"/>
								<field name="min_date" invisible="1"/>
								<field name="origin" placeholder="e.g. PO0032" class="oe_inline"/>
								<label for="owner_id" groups="stock.group_tracking_owner"/>
								<div groups="stock.group_tracking_owner">
									<field name="owner_id"/>
									<button name="action_assign_owner" string="Assign Owner" type="object" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state', 'not in', ('draft','assigned','confirmed'))]}"
										class="oe_link oe_edit_only"/>
								</div>
							</group>
						</group>
						<notebook>
							<page string="Products">
								<separator string="Stock Moves" attrs="{'invisible': [('pack_operation_exist', '=', False)]}"/>
								<field name="move_lines" attrs="{'readonly': [('state','!=','draft')]}" context="{'address_in_id': partner_id, 'form_view_ref':'applico_v8.view_move_internal_picking_form', 'tree_view_ref':'applico_v8.view_move_internal_picking_tree', 'default_picking_type_id': picking_type_id,'default_picking_id': active_id}"/>
								<field name="pack_operation_exist" invisible="1"/>
								<field name="note" placeholder="Add an internal note..." class="oe_inline"/>
							</page>
							<page string="Operations" attrs="{'invisible': ['|', ('state','!=','done'), ('pack_operation_ids','=',[])]}">
								<field name="pack_operation_ids" context="{'default_picking_id': active_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
									<tree editable="top">
										<field name="package_id" groups="stock.group_tracking_lot"/>
										<field name="product_id" on_change="product_id_change(product_id, product_uom_id, product_qty)"/>
										<field name="product_uom_id" groups="product.group_uom"/>
										<field name="lot_id" domain="[('product_id','=?', product_id)]" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
										<field name="picking_id" invisible="1"/>
										<field name="owner_id" groups="stock.group_tracking_owner"/>
										<field name="product_qty" attrs="{'required': [('product_id', '!=', False)]}"/>
										<field name="location_id" domain="[('id', 'child_of', parent.location_id)]"/>
										<field name="location_dest_id" domain="[('id', 'child_of', parent.location_dest_id)]"/>
										<field name="result_package_id" groups="stock.group_tracking_lot" context="{'location_id': location_dest_id}"/>
									</tree>
								</field>
								<p class="oe_grey" groups="stock.group_tracking_lot">
									If there is no product but a source package, this means the source package was moved entirely.  If there is a product and a source package, the product was taken from the source package.  
								</p>
							</page>
							<page string="Additional Info">
								<group string="General Informations">
									<group>
										<field name="move_type" invisible="1"/>
										<field name="invoice_state" readonly='1' groups="account.group_account_invoice"/>
										<field name="picking_type_id" readonly='1'/>
										<field name="allow_create" invisible="1"/>
										<field name="picking_type_code" invisible="1"/>
										<field name="quant_reserved_exist" invisible="1"/>
										<field name="location_id" invisible="1"/>
										<field name="location_dest_id" invisible="1"/>
									</group>
									<group>
										<field name="company_id" groups="base.group_multi_company" widget="selection"/>
										<field name="date_done" groups="base.group_no_one"/>
										<field name="group_id"/>
										<field name="priority"/>
									</group>
								</group>
							</page>
						</notebook>
					</sheet>
					<div class="oe_chatter">
						<field name="message_follower_ids" widget="mail_followers"/>
						<field name="message_ids" widget="mail_thread"/>
					</div>
				</form>
			</field>
		</record>

		<record id="action_internal_picking_tree_ready" model="ir.actions.act_window">
			<field name="name">Ready Transfers</field>
			<field name="res_model">stock.picking</field>
			<field name="type">ir.actions.act_window</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form,calendar</field>
			<field name="domain">[('picking_type_id','=',active_id)]</field>
			<field name="context">{
				'search_default_picking_type_id': [active_id],
				'default_picking_type_id': active_id,
				'contact_display': 'partner_address',
				'search_default_available': 1,
				'default_allow_create': 1,
			}
			</field>
			<field name="search_view_id" ref="stock.view_picking_internal_search"/>
		</record>

		<record id="action_internal_picking_tree_ready_tree" model="ir.actions.act_window.view">
			<field eval="1" name="sequence"/>
			<field name="view_mode">tree</field>
			<field name="act_window_id" ref="action_internal_picking_tree_ready"/>
		</record>

		<record id="action_internal_picking_tree_ready_form" model="ir.actions.act_window.view">
			<field eval="2" name="sequence"/>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_internal_picking_form"/>
			<field name="act_window_id" ref="action_internal_picking_tree_ready"/>
		</record>

		<record id="action_internal_picking_tree_done" model="ir.actions.act_window">
			<field name="name">Done Internal Move</field>
			<field name="res_model">stock.picking</field>
			<field name="type">ir.actions.act_window</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form,calendar</field>
			<field name="domain">[('picking_type_id','=',active_id)]</field>
			<field name="context">{
				'search_default_picking_type_id': [active_id],
				'default_picking_type_id': active_id,
				'contact_display': 'partner_address',
				'search_default_done': 1,
				'default_allow_create': 1,
				}
			</field>
			<field name="search_view_id" ref="stock.view_picking_internal_search"/>
		</record>

		<record id="action_internal_picking_tree_done_tree" model="ir.actions.act_window.view">
			<field eval="1" name="sequence"/>
			<field name="view_mode">tree</field>
			<field name="act_window_id" ref="action_internal_picking_tree_done"/>
		</record>

		<record id="action_internal_picking_tree_done_form" model="ir.actions.act_window.view">
			<field eval="2" name="sequence"/>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_internal_picking_form"/>
			<field name="act_window_id" ref="action_internal_picking_tree_done"/>
		</record>

		<record id="action_internal_picking_tree_waiting" model="ir.actions.act_window">
			<field name="name">Waiting Availability Internal Move</field>
			<field name="res_model">stock.picking</field>
			<field name="type">ir.actions.act_window</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form,calendar</field>
			<field name="domain">[('picking_type_id','=',active_id)]</field>
			<field name="context">{
				'search_default_picking_type_id': [active_id],
				'default_picking_type_id': active_id,
				'contact_display': 'partner_address',
				'search_default_waiting': 1,
				'default_allow_create': 1,
			}
			</field>
			<field name="search_view_id" ref="stock.view_picking_internal_search"/>
		</record>

		<record id="action_internal_picking_tree_waiting_tree" model="ir.actions.act_window.view">
			<field eval="1" name="sequence"/>
			<field name="view_mode">tree</field>
			<field name="act_window_id" ref="action_internal_picking_tree_waiting"/>
		</record>

		<record id="action_internal_picking_tree_waiting_form" model="ir.actions.act_window.view">
			<field eval="2" name="sequence"/>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_internal_picking_form"/>
			<field name="act_window_id" ref="action_internal_picking_tree_waiting"/>
		</record>

		<record id="action_internal_picking_tree" model="ir.actions.act_window">
			<field name="name">Internal Move</field>
			<field name="res_model">stock.picking</field>
			<field name="type">ir.actions.act_window</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form,calendar</field>
			<field name="domain">[('picking_type_id','=',active_id)]</field>
			<field name="context">{
				'search_default_picking_type_id': [active_id],
				'default_picking_type_id': active_id,
				'contact_display': 'partner_address',
				'default_allow_create': 1,
			}
			</field>
			<field name="search_view_id" ref="stock.view_picking_internal_search"/>
			<field name="help" type="html">
				<p class="oe_view_nocontent_create">
					Click to create a stock operation. 
				</p>
			</field>
		</record>

		<record id="action_internal_picking_tree_tree" model="ir.actions.act_window.view">
			<field eval="1" name="sequence"/>
			<field name="view_mode">tree</field>
			<field name="act_window_id" ref="action_internal_picking_tree"/>
		</record>

		<record id="action_internal_picking_tree_form" model="ir.actions.act_window.view">
			<field eval="2" name="sequence"/>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_internal_picking_form"/>
			<field name="act_window_id" ref="action_internal_picking_tree"/>
		</record>

		<record id="action_internal_picking_tree_late" model="ir.actions.act_window">
			<field name="name">Late Transfers</field>
			<field name="res_model">stock.picking</field>
			<field name="type">ir.actions.act_window</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form,calendar</field>
			<field name="domain">[('picking_type_id','=',active_id)]</field>
			<field name="context">{
				'search_default_picking_type_id': [active_id],
				'default_picking_type_id': active_id,
				'contact_display': 'partner_address',
				'search_default_late': 1,
				'search_default_confirmed': 1,
				'default_allow_create': 1,
			}
			</field>
			<field name="search_view_id" ref="stock.view_picking_internal_search"/>
		</record>

		<record id="action_internal_picking_tree_late_tree" model="ir.actions.act_window.view">
			<field eval="1" name="sequence"/>
			<field name="view_mode">tree</field>
			<field name="act_window_id" ref="action_internal_picking_tree_late"/>
		</record>

		<record id="action_internal_picking_tree_late_form" model="ir.actions.act_window.view">
			<field eval="2" name="sequence"/>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_internal_picking_form"/>
			<field name="act_window_id" ref="action_internal_picking_tree_late"/>
		</record>

		<record id="action_internal_picking_tree_backorder" model="ir.actions.act_window">
			<field name="name">Backorders</field>
			<field name="res_model">stock.picking</field>
			<field name="type">ir.actions.act_window</field>
			<field name="view_type">form</field>
			<field name="view_mode">tree,form,calendar</field>
			<field name="domain">[('picking_type_id','=',active_id)]</field>
			<field name="context">{
				'search_default_picking_type_id': [active_id],
				'default_picking_type_id': active_id,
				'contact_display': 'partner_address',
				'search_default_backorder': 1,
				'search_default_confirmed': 1,
				'default_allow_create': 1,
			}
			</field>
			<field name="search_view_id" ref="stock.view_picking_internal_search"/>
		</record>

		<record id="action_internal_picking_tree_backorder_tree" model="ir.actions.act_window.view">
			<field eval="1" name="sequence"/>
			<field name="view_mode">tree</field>
			<field name="act_window_id" ref="action_internal_picking_tree_backorder"/>
		</record>

		<record id="action_internal_picking_tree_backorder_form" model="ir.actions.act_window.view">
			<field eval="2" name="sequence"/>
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_internal_picking_form"/>
			<field name="act_window_id" ref="action_internal_picking_tree_backorder"/>
		</record>

		<record id="internal_move_type_kanban" model="ir.ui.view">
			<field name="name">internal.move.type.kanban</field>
			<field name="model">stock.picking.type</field>
			<field eval="20" name="priority"/>
			<field name="arch" type="xml">
				<kanban class="oe_background_grey" create="0">
					<field name="complete_name"/>
					<field name="color"/>
					<field name="count_picking_ready"/>
					<field name="count_picking_draft"/>
					<field name="count_picking_waiting"/>
					<field name="count_picking_late"/>
					<field name="count_picking_backorders"/>
					<templates>
						<t t-name="kanban-box">
							<div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_stock_picking_type">
								<div class="oe_dropdown_toggle oe_dropdown_kanban" groups="stock.group_stock_manager">
									<span class="oe_e">í</span>
									<ul class="oe_dropdown_menu">
										<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
										<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
										<t t-if="widget.view.is_action_enabled('edit')"><li><ul class="oe_kanban_colorpicker" data-field="color"/></li></t>
									</ul>
								</div>
								<div class="oe_kanban_content">
									<h4 class="text-center"><strong><field name="complete_name"/></strong></h4>
									<div class="oe_right">
										<a name="open_barcode_interface" type="object">
											<img src="/stock/static/src/img/scan.png"
												alt="Click to launch the barcode interface"
												class="oe_stock_scan_image" title="Click to launch the barcode interface"/>
										</a>
									</div>
									<div class="oe_items_list oe_kanban_ellipsis">
										<div>
											<a name="%(action_internal_picking_tree_ready)d" type="action">
												<field name="count_picking_ready"/> Ready
											</a>
											<a name="%(action_internal_picking_tree_done)d" type="action" class="oe_sparkline_bar_link">
												<field name="last_done_picking" widget="sparkline_bar" options="{'type': 'tristate', 'colorMap': {'0': 'orange', '-1': 'red', '1': 'green'}}">Last 10 Done Operations</field>
											</a>
										</div>
										<div t-if="record.count_picking_waiting.raw_value &gt; 0">
											<a name="%(action_internal_picking_tree_waiting)d" type="action">
												<field name="count_picking_waiting"/> Waiting Availability
											</a>
										</div>
										<div>
											<a name="%(action_internal_picking_tree)d" type="action">All Operations</a>
										</div>
									</div>
									<div class="oe_picking_type_gauge">
										<field name="rate_picking_late" widget="gauge" style="width:150px; height: 110px;" options="{'levelcolors': ['#a9d70b', '#f9c802', '#ff0000'], 'action_jump': '%(action_internal_picking_tree_late)d'}">Late (%%)</field>
										<field name="rate_picking_backorders" widget="gauge" style="width:150px; height: 110px;">Backorders (%%)</field>
										<div class="oe_gauge_labels">
											<div class="oe_gauge_label_column">
												<a name="%(action_internal_picking_tree_late)d" type="action">
													<field name="count_picking_late"/> Late
												</a>
											</div>
											<div class="oe_gauge_label_column">
												<a name="%(action_internal_picking_tree_backorder)d" type="action">
													<field name="count_picking_backorders"/> Backorders
												</a>
											</div>
										</div>
									</div>
								</div>
							</div>
						</t>
					</templates>
				</kanban>
			</field>
		</record>

		<record id="action_internal_type_form" model="ir.actions.act_window">
			<field name="name">Internal Move</field>
			<field name="res_model">stock.picking.type</field>
			<field name="type">ir.actions.act_window</field>
			<field name="view_type">form</field>
			<field name="domain">[('code','=','internal')]</field>
			<field name="view_mode">kanban,form</field>
			<field name="help" type="html">
				<p class="oe_view_nocontent_create">
					Click to create a new picking type. 
				</p>
			</field>
		</record>

		<record id="action_internal_type_form_tree" model="ir.actions.act_window.view">
			<field eval="1" name="sequence"/>
			<field name="view_mode">kanban</field>
			<field name="view_id" ref="internal_move_type_kanban"/>
			<field name="act_window_id" ref="action_internal_type_form"/>
		</record>

        <menuitem
            action="action_internal_type_form"
            id="menu_action_internal_picking_type_form"
            parent="stock.menu_stock_warehouse_mgmt" sequence="2"/>

<!--  Stock Picking IN -->
		<record id="stock.action_picking_type_form" model="ir.actions.act_window">
			<field name="domain">[('code','in',('incoming','outgoing'))]</field>
		</record>

		<record id="vpicktree_applico" model="ir.ui.view">
			<field name="name">stock.picking.tree.applico</field>
			<field name="model">stock.picking</field>
			<field name="inherit_id" ref="stock.vpicktree"/>
			<field name="arch" type="xml">
				<field name="state" position="after">
					<field name="ret_name"/>
				</field>
			</field>
		</record>


		<record id="view_picking_form_applico" model="ir.ui.view">
			<field name="name">stock.picking.form.applico</field>
			<field name="model">stock.picking</field>
			<field name="inherit_id" ref="stock.view_picking_form"/>
			<field name="arch" type="xml">
				<button name="action_cancel" position="replace">
					<button name="action_cancel" states="assigned,confirmed,partially_available,draft" string="Cancel Transfer" groups="stock.group_stock_manager" type="object"/>
				</button >
				<button name="%(stock.act_stock_return_picking)d" position="replace">
					<button name="%(stock.act_stock_return_picking)d" string="Reverse Transfer" states="done" type="action" groups="stock.group_stock_manager"/>
				</button>
				<button name="action_cancel" position="after">
					<button name="revert_invoice" attrs="{'invisible':[('invoice_state','!=','invoiced')]}" string="Revert To non Invoiced" type="object" groups="stock.group_stock_manager"/>
					<button name="action_cancel2" states="done" string="Cancel Transfer" groups="stock.group_stock_manager" type="object"/>
				</button>
				<field name="picking_type_id" position="replace">
					<field name="picking_type_id" readonly='1'/>
					<field name="ret_name" readonly='1'/>
					<field name="footer_note"/>
					<field name="allow_create" readonly='1' invisible="1"/>
				</field>
	
				<field name="move_type" position="replace">
					<field name="move_type" invisible="1"/>
				</field>

				<field name="state" position="replace">
					<field name="state" widget="statusbar" statusbar_visible="assigned,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
				</field>
			</field>
		</record>


		<record id="view_picking_inherit_form2_applico" model="ir.ui.view">
			<field name="name">stock.picking.form.inherit.applico</field>
			<field name="model">stock.picking</field>
			<field name="inherit_id" ref="stock_account.view_picking_inherit_form2"/>
			<field name="arch" type="xml">

				<field name="invoice_state" position="replace">
					<field name="invoice_state" readonly='1' groups="account.group_account_invoice"/>
				</field>
				<field name="move_lines" position="replace">
					<field name="move_lines" readonly="1" context="{'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'default_picking_type_id': picking_type_id,'default_picking_id': active_id}"/>
				</field>
			</field>
		</record>


		<record id="view_move_picking_tree_applico" model="ir.ui.view">
			<field name="name">stock.move.tree.applico</field>
			<field name="model">stock.move</field>
			<field name="inherit_id" ref="stock.view_move_picking_tree"/>
			<field name="arch" type="xml">

				<button name="%(stock.move_scrap)d" position="replace">
					<button name="%(stock.move_scrap)d"
						string="Scrap Products" type="action"
						icon="terp-gtk-jump-to-ltr" context="{'scrap': True}"
						states="draft,waiting,confirmed,assigned"
						invisible="1"/>
				</button>
				<field name="string_availability_info" position="replace">
					<field name="string_availability_info" invisible="1"/>
				</field>
				
			</field>
		</record>

		<record id="view_move_picking_form_applico" model="ir.ui.view">
			<field name="name">sstock.move.form.applico</field>
			<field name="model">stock.move</field>
			<field name="inherit_id" ref="stock.view_move_picking_form"/>
			<field name="arch" type="xml">
				<button name="force_assign" position="replace">
					<button name="force_assign" invisible="1" string="Force Availability" type="object" groups="base.group_user"/>
				</button>
				<button name="action_confirm" position="replace">
					<button name="action_confirm" invisible="1" string="Confirm" type="object" groups="base.group_user"/>
				</button>
				<button name="do_unreserve" position="replace">
					<button name="do_unreserve" invisible="1" string="Cancel Availability" type="object" groups="base.group_user"/>
				</button>
				<button name="%(stock.move_scrap)d" position="replace">
					<button name="%(stock.move_scrap)d"
						string="Scrap" type="action"
						icon="terp-gtk-jump-to-ltr" context="{'scrap': True}"
						states="draft,waiting,confirmed,assigned"
						invisible="1"/>
				</button>
				<group name="quants_grp" position="replace">
					<group name="quants_grp" string="Reserved Quants" colspan="4" invisible="1">
						<field name="reserved_quant_ids"/>
					</group>
				</group>
				
			</field>
		</record>


<!-- Hidden Menu -->
		<record id="stock.menu_traceability" model="ir.ui.menu">
			<field name="groups_id" eval="[(6,0,[ref('hidden_applico')])]"/>
		</record>
		<record id="stock.menu_stock_sched" model="ir.ui.menu">
			<field name="groups_id" eval="[(6,0,[ref('hidden_applico')])]"/>
		</record>

		<record id="stock.menu_stock_order_points" model="ir.ui.menu">
			<field name="groups_id" eval="[(6,0,[ref('hidden_applico')])]"/>
		</record>

		<record id="stock.menu_procurement_rules" model="ir.ui.menu">
			<field name="groups_id" eval="[(6,0,[ref('hidden_applico')])]"/>
		</record>

		<record id="stock.menu_stock_routes" model="ir.ui.menu">
			<field name="groups_id" eval="[(6,0,[ref('hidden_applico')])]"/>
		</record>

		<record id="stock_account.menu_action_history_tree" model="ir.ui.menu">
			<field name="groups_id" eval="[(6,0,[ref('hidden_applico')])]"/>
		</record>s


<!-- Physical Inventory-->
		<record id="view_inventory_form_applico" model="ir.ui.view">
			<field name="name">view.inventory.form.applico</field>
			<field name="model">stock.inventory</field>
			<field name="inherit_id" ref="stock.view_inventory_form"/>
			<field name="arch" type="xml">
				<field name="state" position="replace">
					<field name="state" widget="statusbar" statusbar_visible="draft,done"/>
				</field>
				<button name="action_cancel_inventory" position="replace">
					<button name="action_cancel_inventory" string="Cancel Inventory" states="done" type="object" groups="stock.group_stock_manager"/>
				</button>
				<button name="prepare_inventory" position="replace">
					<button name="prepare_inventory" states="draft" string="Start Inventory" type="object" class="oe_highlight" invisible="1" groups="stock.group_stock_user"/>
				</button>
				<button name="action_done" position="replace">
					<button name="action_done2" string="Validate Inventory" type="object" class="oe_highlight" states="draft" groups="stock.group_stock_manager"/>
				</button>
				<field name="name" position="replace">
					<field name="name" required="0" readonly="1" placeholder="e.g. Annual inventory"/>
				</field>
				<field name="date" position="replace">
					<field name="date" readonly="0"/>
					<field name="int_type_id"/>
				</field>
				<field name="location_id" position="replace">
					<field name="reason"/>
					<field name="location_id" domain="[('usage','=','internal')]"/>
				</field>
				<field name="filter" position="replace">
					<field name="filter" invisible="1" string="Inventory of" widget='radio' attrs="{'readonly': [('state', '!=', 'draft')]}"/>
				</field>
				<xpath expr="//sheet/notebook" position="replace">
					<notebook>
                        <page string="Inventory Details" >
                            <button name="reset_real_qty" states="confirm" string="⇒ Set quantities to 0" type="object" class="oe_link oe_right" groups="stock.group_stock_user"/>
                            <field name="line_ids" string="Inventory Details" context="{'default_location_id': location_id,  'default_product_id': product_id, 'default_prod_lot_id': lot_id, 'default_package_id': package_id, 'default_partner_id': partner_id}">
                                <tree string="Inventory Details" editable="bottom">
                                    <field context="{'location':location_id, 'uom':product_uom_id, 'to_date':parent.date}" name="product_id" on_change="on_change_product_id(product_id,product_uom_id,theoretical_qty,context)" domain="[('type','=','product')]"/>
                                    <field name="product_uom_id" groups="product.group_uom" on_change="restrict_change(theoretical_qty)"/>
                                    <field domain="[('usage','=','internal')]" name="location_id" groups="stock.group_locations" on_change="restrict_change(theoretical_qty)"/>
                                    <field name="prod_lot_id" on_change="restrict_change(theoretical_qty)" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}"  groups="stock.group_production_lot"/>
                                    <field name="package_id" on_change="restrict_change(theoretical_qty)" groups="stock.group_tracking_lot"/>
                                    <field name="partner_id" on_change="restrict_change(theoretical_qty)" groups="stock.group_tracking_owner"/>
                                    <field name="theoretical_qty" readonly="1" invisible="1"/>
                                    <field name="product_qty" string="Quantity"/>
                                    <field name="price_unit"/>
									<field name="note"/>
                                    <field name="state" invisible="True"/>
                                </tree>
                            </field>
                        </page>
                        <page string="Inventory Adjustments" attrs="{'invisible': [('state', '!=', 'done')]}">
                            <field name="move_ids">
                                <tree colors="grey:scrapped == True" string="Stock Moves">
                                    <field name="product_id"/>
                                    <field name="product_uom_qty" on_change="onchange_quantity(product_id, product_uom_qty, product_uom, product_uos)"/>
                                    <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
                                    <field name="product_uos" groups="product.group_uos"/>
                                    <field name="picking_id" invisible="1" />
                                    <field name="create_date" invisible="1" />
                                    <field name="date_expected" invisible="1" />
                                    <button name="%(stock.move_scrap)d"
                                       string="Scrap Products" type="action"
                                       icon="terp-gtk-jump-to-ltr" context="{'scrap': True}"
                                       states="draft,waiting,confirmed,assigned"
                                       groups="base.group_user"/>
                                    <field name="scrapped" invisible="1"/>
                                    <field name="location_id"/>
                                    <field name="location_dest_id"/>
                                    <field name="state"/>
                                </tree>
                            </field>
                        </page>
						<page string="Other Information">
							<group>
								<field name="approved_zero" invisible="1"/>
								<field name="zero_approver" readonly="1"/>
								<field name="zero_date" readonly="1"/>
								<button name="action_approve_zero" attrs="{'invisible': [('approved_zero', '=', True)]}" string="Approved Zero Allowed" type="object" icon="gtk-go-forward" groups="stock.group_stock_manager"/>
								<button name="action_undo_zero" attrs="{'invisible': [('approved_zero', '=', False)]}" string="Undo Zero Allowed Approved" type="object" icon="gtk-go-back" groups="stock.group_stock_manager"/>
							</group>
						</page>
                    </notebook>
				</xpath>
			</field>
		</record>

		<record id="view_inventory_form_inherit_applico" model="ir.ui.view">
			<field name="name">stock.inventory.form.inherit.applico</field>
			<field name="model">stock.inventory</field>
			<field name="inherit_id" ref="stock_account.view_inventory_form_inherit"/>
			<field name="arch" type="xml">
				<field name="period_id" position="replace">
					<field name="period_id" invisible="1"/>
				</field>
			</field>
		</record>
	</data>
</openerp>
